package cn.kust.microtourismcommon.remote;


import cn.kust.microtourismcommon.pojo.dto.MicroTourismUser;
import cn.kust.microtourismcommon.pojo.dto.ResponseResult;
import cn.kust.microtourismcommon.pojo.dto.UserIdDTO;
import cn.kust.microtourismcommon.pojo.dto.UserNameAvatar;
import cn.kust.microtourismcommon.pojo.request.VerificationCodeDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@FeignClient(value = "service-userCenter",path = "/userCenter")
@Component
public interface ServiceUserCenterClient {

    @RequestMapping(method = RequestMethod.POST, value = "/user")
    ResponseResult<MicroTourismUser> loginOrRegister(@RequestBody VerificationCodeDTO verificationCodeDTO);

    @RequestMapping(method = RequestMethod.GET, value ="/user/{phone}")
    ResponseResult<MicroTourismUser> getUserByPhone(@PathVariable("phone") String userPhone);

    @RequestMapping(value = "/user/list/name-avatar", method = RequestMethod.POST)
    ResponseResult<List<UserNameAvatar>> getUserNameAvatarList(@RequestBody UserIdDTO userIdDTO);

    @RequestMapping(value = "/user/user-name-avatar/{userId}", method = RequestMethod.GET)
    ResponseResult<UserNameAvatar> getUserNameAvatarById(@PathVariable("userId")  Long userId);



}
